<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>Excel导入配置管理</title>
<script type="text/javascript">
	var $grid;
	var $excelConfigTreeGrid;
	var selectTableRow;//选中的行数据
	var costEditRowIndex = -1;
	$(function() {
		$grid = $("#grid").datagrid(
				$.extend(datagridOption, {
					url : "${ctx}/basic/excelImport/dataGrid",
					columns : [ [
							{
								field : 'ck',
								checkbox : true
							},{
								field : 'importNo',
								title : '导入编号',
								width : 120,
								sortable : true
							},{
								field : 'importName',
								title : '模板名称',
								width : 120,
								sortable : true
							},
							{
								field : 'tableName',
								title : '表名称',
								width : 120,
								sortable : true
							},{
								field : 'isOverride',
								title : '是否覆盖',
								width : 90,
								formatter : function(value, row, index) {
									return '<input class="easyui-switchbutton "' + (value == 1 ? "checked" : "")
											+ ' data-options="readonly:true,onText:\'是\',offText:\'否\'">';
								}
							},{
								field : 'withAttachment',
								title : '是否有附件',
								width : 90,
								formatter : function(value, row, index) {
									return '<input class="easyui-switchbutton "' + (value == 1 ? "checked" : "")
											+ ' data-options="readonly:true,onText:\'是\',offText:\'否\'">';
								}
							}, {
								field : 'remark',
								title : '备注',
								width : 90,
								sortable : true
							} ] ],
					onClickRow : function(rowIndex, rowData) {
						selectTableRow = rowData;
						$("#cc").layout("panel", "east").panel({
							title : "【" + rowData.importName + "】配置明细管理"
						});
						costEditRowIndex = -1;
						$excelConfigTreeGrid.datagrid("clearSelections");//清除所有选中的行，解决切换不同代码表后还保留代码值中上次选中行bug
						refreshExcelConfig(rowData);//刷新代码表明细
					}
				}));
		$grid.datagrid('enableFilter');

		$("#isOverrideSB").switchbutton({
			onText : "是",
			offText : "否",
			checked : true,
			onChange : function(checked) {
				if (checked) {
					$("#isOverride").val(1);
				} else {
					$("#isOverride").val(2);
				}
			}
		});
		$("#withAttachmentSB").switchbutton({
			onText : "是",
			offText : "否",
			checked : true,
			onChange : function(checked) {
				if (checked) {
					$("#withAttachment").val(1);
				} else {
					$("#withAttachment").val(2);
				}
			}
		});

		$excelConfigTreeGrid = $("#excelConfigTreeGrid").datagrid(
				$.extend(datagridOption, {
					url : "",
					toolbar : '#configtt',
					columns : [ [
							{
								field : 'ck',
								checkbox : true
							},{
								field : 'excelImport',
								title : '导入编号',
								sortable : true,
								formatter : function(value, row, index) {
									return value ? value.importNo : "";
								}
							},{
								field : 'chineseName',
								title : '中文列名',
								sortable : true,
								//editor : "validatebox"
							},{
								field : 'columnName',
								title : '字段名称',
								sortable : true,
								//editor : "validatebox"
							},{
								field : 'columnNo',
								title : '列序号',
								sortable : true,
								//editor : "validatebox"
							},{
								field : 'codeValues',
								title : 'Java类型',
								sortable : true,
								formatter : function(value, row, index) {
									row['javaType'] = value.id;
									return value ? value.codeName : "";
								},
								/* editor : {
									type : "combobox",
									options : {
										required : true,
										editable : false,
										url : "${ctx}/basic/excelConfig/comboboxJavaType",
										valueField : "id",
										textField : "codeName",
										onSelect : function(value) {
											var line = $excelConfigTreeGrid.datagrid('getRows')[costEditRowIndex];
											line.editType = value;
										}
									}
								} */
							},{
								field : 'isUnionUnique',
								title : '是否联合唯一',
								formatter : function(value, row, index) {
									return '<input class="easyui-switchbutton "' + (value == 1 ? "checked" : "")
											+ ' data-options="readonly:true,onText:\'是\',offText:\'否\'">';
								}/*,
								editor : {
								type : "combobox",
								options : {
									required : true,
									editable : false,
									data : [ {
										"id" : "1",
										"text" : "是"
									}, {
										"id" : "2",
										"text" : "否"
									} ],
									valueField : "id",
									textField : "text"
								}
							}*/																												
							},{
								field : 'isForeignKey',
								title : '是否为外键',
								formatter : function(value, row, index) {
									return '<input class="easyui-switchbutton "' + (value == 1 ? "checked" : "")
											+ ' data-options="readonly:true,onText:\'是\',offText:\'否\'">';
								}/*,
								editor : {
								type : "combobox",
								options : {
									required : true,
									editable : false,
									data : [ {
										"id" : "1",
										"text" : "是"
									}, {
										"id" : "2",
										"text" : "否"
									} ],
									textField : "text",
									valueField : "id"
								}
							}*/																											
							},{
								field : 'foreignTableName',
								title : '关联表名称',
								sortable : true,
								editor : "validatebox"
							},{
								field : 'fkColumnName',
								title : '关联字段名称',
								sortable : true,
								editor : "validatebox"
							},{
								field : 'foreignTableAssistColumnName',
								title : '关联表的辅助字段名称',
								sortable : true,
								editor : "validatebox"
							},{
								field : 'isAssistColumn',
								title : '是否是辅助字段',
								formatter : function(value, row, index) {
									return '<input class="easyui-switchbutton "' + (value == 1 ? "checked" : "")
											+ ' data-options="readonly:true,onText:\'是\',offText:\'否\'">';
								}/*,
								editor : {
								type : "combobox",
								options : {
									required : true,
									editable : false,
									data : [ {
										"id" : "1",
										"text" : "是"
									}, {
										"id" : "2",
										"text" : "否"
									} ],
									textField : "text",
									valueField : "id"
								}
							}*/																											
							}, {
								field : 'assistForeignTableName',
								title : '辅助关联表名称',
								sortable : true,
								editor : "validatebox"
							}, {
								field : 'assistFkColumnName',
								title : '辅助关联字段名称',
								sortable : true,
								editor : "validatebox"
							}, {
								field : 'assistExcelColumnNo',
								title : '辅助值Excel列数',
								sortable : true,
								editor : "validatebox"
							}, {
								field : 'otherColumns',
								title : '其他关联字段集',
								sortable : true,
								editor : "validatebox"
							}, {
								field : 'otherValues',
								title : '其他关联字段值',
								sortable : true,
								editor : "validatebox"
							}, {
								field : 'convertMap',
								title : '转换Map',
								sortable : true,
								editor : "validatebox"
							}, {
								field : 'remark',
								title : '备注',
								sortable : true,
								editor : "validatebox"
							} ] ],
					enableHeaderClickMenu : true, //此属性开启表头列名称右侧那个箭头形状的鼠标左键点击菜单
					enableHeaderContextMenu : true, //此属性开启表头列名称右键点击菜单
					enableRowContextMenu : true,
					onClickRow : function(rowIndex, rowData) {

					},
					autoEditingEvent : "onDblClickRow",
					autoEditing : false, //该属性启用双击行时自定开启该行的编辑状态
					extEditing : true, //该属性启用行编辑状态的 ExtEditing 风格效果，该属性默认为 true。
					singleEditing : false,
					onBeforeEdit : function(rowIndex, rowData) {
						var _onBeforeEdit = $.fn.datagrid.extensions.onBeforeEdit;
						if ($.isFunction(_onBeforeEdit)) {
							_onBeforeEdit.apply(this, arguments);
						}
						costEditRowIndex = rowIndex;
						rowData.editType = rowData.codeValues;
						rowData.codeValues = rowData.codeValues.id;
					},
					onCancelEdit : function(rowIndex, rowData) {
						if (rowData.codeValues.id == null && rowData.editType != null) {
							rowData.codeValues = rowData.editType;
						}
						$excelConfigTreeGrid.datagrid("refreshRow", rowIndex);
					},
					onAfterEdit : function(rowIndex, rowData, changes) {
						$.fn.datagrid.extensions.onAfterEdit.apply(this, arguments); //这句一定要加上
						if (rowData.codeValues.id == null && rowData.editType != null) {
							rowData.codeValues = rowData.editType;
						}
						$excelConfigTreeGrid.datagrid("updateRow", {
							index : rowIndex,
							row : rowData
						});
					}
				}));

		$("#isUnionUniqueSB").switchbutton({
			onText : "是",
			offText : "否",
			checked : true,
			onChange : function(checked) {
				if (checked) {
					$("#isUnionUnique").val(1);
				} else {
					$("#isUnionUnique").val(2);
				}
			}
		});

		$("#isForeignKeySB").switchbutton({
			onText : "是",
			offText : "否",
			checked : true,
			onChange : function(checked) {
				if (checked) {
					$("#isForeignKey").val(1);
				} else {
					$("#isForeignKey").val(2);
				}
			}
		});

		$("#isAssistColumnSB").switchbutton({
			onText : "是",
			offText : "否",
			checked : true,
			onChange : function(checked) {
				if (checked) {
					$("#isAssistColumn").val(1);
				} else {
					$("#isAssistColumn").val(2);
				}
			}
		});

		$("#add").click(function() {
			$("#fm").form("clear");
			$('#fm').form('load', {
				enable : 1,
				isOverride : 2,
				withAttachment : 2
			});
			$("#isOverrideSB").switchbutton("check");
			$("#withAttachmentSB").switchbutton("uncheck");

			$("#dlg").dialog("open").dialog("setTitle", "新增Excel导入");
		});
		$("#configadd").click(function() {
			if (!selectTableRow) {
				$.messager.show({
					icon : "error",
					msg : "请先选中Excel导入中的行"
				});
				return false;
			}
			fn_initCombo();
			$("#configfm").form("clear");
			$('#configfm').form('load', {
				isForeignKey : 2,
				isUnionUnique : 2,
				isAssistColumn : 2,
				excelImport : selectTableRow.id
			});
			$("#isForeignKeySB").switchbutton("uncheck");
			$("#isUnionUniqueSB").switchbutton("uncheck");
			$("#isAssistColumnSB").switchbutton("uncheck");
			$('#javaType').combotree("setValue", "4028b881459c885401459c9bdb460053");//默认String

			$("#configdlg").dialog("open").dialog("setTitle", "新增代码");
		});
		$("#edit").click(function() {
			var rowData = $grid.datagrid("getSelected");
			if (rowData == null) {
				$.messager.show({
					msg : "您未选中行，无法编辑",
					icon : "warning",
					position : "bottomRight"
				});
			} else {
				$("#dlg").dialog("open").dialog("setTitle", "编辑Excel导入");
				$("#fm").form("load", rowData);
				$("#isOverrideSB").switchbutton(rowData.isOverride == 1 ? "check" : "uncheck");
				$("#withAttachmentSB").switchbutton(rowData.withAttachment == 1 ? "check" : "uncheck");
			}
		});
		$("#configedit").click(function() {
			var rowData = $excelConfigTreeGrid.datagrid("getSelected");
			if (rowData == null) {
				$.messager.show({
					msg : "您未选中行，无法编辑",
					icon : "warning",
					position : "bottomRight"
				});
			} else {
				fn_initCombo();
				$("#configdlg").dialog("open").dialog("setTitle", "编辑代码");
				$("#configfm").form("clear");
				$("#configfm").form("load", rowData);
				$('#configfm').form('load', {
					excelImport : rowData.excelImport.id
				});
				$("#isUnionUniqueSB").switchbutton(rowData.isUnionUnique == 1 ? "check" : "uncheck");
				$("#isAssistColumnSB").switchbutton(rowData.isAssistColumn == 1 ? "check" : "uncheck");
				$("#isForeignKeySB").switchbutton(rowData.isForeignKey == 1 ? "check" : "uncheck");
			}
		});
		$("#delete").click(function() {
			multiDeleteDataGrid($grid, "${ctx}/basic/excelImport/multiDelete");
			$excelConfigTreeGrid.datagrid("reload");
		});
		$("#configdelete").click(function() {
			multiDeleteDataGrid($excelConfigTreeGrid, "${ctx}/basic/excelConfig/multiDelete");
		});
		$("#search").click(function() {
			var search_LIKE_tableName = $("#search_LIKE_tableName").val();
			$grid.datagrid('load', {
				search_LIKE_tableName : search_LIKE_tableName
			});
		});
		$("#configsearch").click(function() {
			
			var search_LIKE_columnName = selectTableRow.importNo;
			$excelConfigTreeGrid.datagrid('load', {
				search_LIKE_columnName : search_LIKE_columnName
			});
		});
		$("#excelExport").click(function() {
			var url = "${ctx}/basic/excelImport/excelExport?" + $.param($grid.datagrid('options').queryParams);
			if ($grid.datagrid("options").filterRules) {
				url += "&filterRules=" + JSON.stringify($grid.datagrid("options").filterRules);
			}
			window.parent.location.href = url;
		});
		$("#excelExportConfig").click(
				function() {
					if (selectTableRow != null) {
						var url = "${ctx}/basic/excelImport/excelExportConfig?search_EQ_excelImport.id="
								+ selectTableRow.id;// + "&search_EQ_columnName=" + selectTableRow.importNo;//$("#search_LIKE_columnName").val();
					} else {
						var search_LIKE_columnName = $("#search_LIKE_columnName").val();
						if (search_LIKE_columnName != null) {
							var url = "${ctx}/basic/excelImport/excelExportConfig?search_LIKE_columnName="
									+ $("#search_LIKE_columnName").val();
						} else {
							var url = "${ctx}/basic/excelImport/excelExportConfig?"
									+ $.param($grid.datagrid('options').queryParams);
						}
					}
					//var url = "${ctx}/basic/excelImport/excelExportConfig?" + $.param($grid.datagrid('options').queryParams);
					/* if ($grid.datagrid("options").filterRules) {
						url += "&filterRules=" + JSON.stringify($grid.datagrid("options").filterRules);
					} */
					window.parent.location.href = url;
				});

		$("#excelImport").click(function() {
			$.easyui.importor.showImportor({
				importNo : "ExcelImport",
				onExportSuccess : function(file, data) {
					$grid.datagrid('load');
					$excelConfigTreeGrid.datagrid("load");
				}
			});
		});

		$("#excelImportConfig").click(function() {
			$.easyui.importor.showImportor({
				importNo : "ExcelConfig",
				onExportSuccess : function(file, data) {
					$grid.datagrid('load');
					$excelConfigTreeGrid.datagrid("load");
				}
			});
		});

		$("#excelall").click(function() {
			$excelConfigTreeGrid.datagrid("clearSelections");//清除所有选中的行，解决始终保留代码值中上次选中行bug
			$excelConfigTreeGrid.datagrid({
				url : "${ctx}/basic/excelConfig/dataGrid"
			});
		});
		$("#bulid").click(function() {
			var rowData = $grid.datagrid("getSelected");
			if (rowData == null) {
				shoeInfo("其选择主表项，不能自动生成相应信息！");
				return false;
			}
			showConfirm("是否确认自动生成【" + rowData.importName + "】的导入明细，将清空该项对应明细后再生成!", function() {
				$.get("${ctx}/basic/excelConfig/bulid?id=" + rowData.id, function(data) {
					$.messager.show({
						title : "信息",
						width : 300,
						height : 100,
						msg : data.msg,
						icon : "info",
						position : "bottomRight"
					});
					if (data.success) {
						$excelConfigTreeGrid.datagrid('removeFilterRule');
						$excelConfigTreeGrid.datagrid("load").datagrid("clearSelections").datagrid("clearChecked");
					}
				}, 'json');
			});
		});
		$("#redo").click(function() {
			$excelConfigTreeGrid.datagrid("rejectChanges");
		});

		$("#save").click(function() {
			showConfirm("确定保存?保存后所有更改将提交生效", function() {
				$excelConfigTreeGrid.datagrid("submitChange", {
					url : "${ctx}/basic/excelConfig/crud"
				});
			});
		});
	});
	function fn_initCombo() {
		$('#javaType').combotree({
			url : '${ctx}/basic/excelConfig/comboTreeJavaType',
			method : 'get',
			editable : false,
			idField : 'id',
			textField : 'text',
			parentField : 'pid',
			dataPlain : true
		});
	}
	function fn_setAssist() {
		$('#configfm').form('load', {
			foreignTableAssistColumnName : "company_type_id",
			assistForeignTableName : "ess_company_type",
			assistFkColumnName : "company_type"
		});
	}
	function fn_setCompany() {
		$('#configfm').form('load', {
			chineseName : "公司类型",
			columnName : "company_type_id",
			isForeignKey : 1,
			foreignTableName : "ess_company_type",
			fkColumnName : "company_type"
		});
	}
	function fn_save() {
		$("#fm").form("submit", {
			url : "${ctx}/basic/excelImport/update",
			success : function(data) {
				$grid.datagrid("load");
				$.messager.show({
					msg : "保存成功",
					icon : "info",
					position : "bottomRight"
				});
				$("#dlg").dialog('close');
			}
		});
	}
	function fn_configsave() {
		$("#configfm").form("submit", {
			url : "${ctx}/basic/excelConfig/update",
			success : function(data) {
				$excelConfigTreeGrid.datagrid("clearSelections");//清除所有选中的行，解决始终保留代码值中上次选中行bug
				$excelConfigTreeGrid.datagrid({
					url : "${ctx}/basic/excelConfig/dataGrid?search_EQ_excelImport.id=" + selectTableRow.id
				});
				$.messager.show({
					msg : "保存成功",
					icon : "info",
					position : "bottomRight"
				});
				$("#configdlg").dialog('close');
			}
		});
	}

	//刷新Excel导入明细列表
	function refreshExcelConfig(rowData) {
		if (!rowData) {
			showAlert("请先选择中类信息");
			return false;
		} else {
			$excelConfigTreeGrid.datagrid({
				url : "${ctx}/basic/excelConfig/dataGrid?search_EQ_excelImport.id=" + rowData.id
			});
		}

	}
</script>
</head>

<body>
	<div data-options="region:'center'" data-options="fit:true"
		style="padding: 1px;">
		<div id="cc" class="easyui-layout" data-options="fit:true"
			style="width: 580px; height: 440px;">
			<div data-options="region:'center'"
				style="padding: 1px; witdh: 400px">
				<table id="grid">
				</table>
				<div id="tt" class="row">
					<div class="col-md-12">
						<shiro:hasPermission name="excelImport:update">
							<button id="add" type="button" class="btn btn-primary">
								<span class="glyphicon glyphicon-plus"></span> 新增
							</button>
							<button id="edit" type="button" class="btn btn-primary">
								<span class="glyphicon glyphicon-pencil"></span> 修改
							</button>
						</shiro:hasPermission>
						<shiro:hasPermission name="excelImport:delete">
							<button id="delete" type="button" class="btn btn-danger">
								<span class="glyphicon glyphicon-minus"></span> 删除
							</button>
						</shiro:hasPermission>
						<shiro:hasPermission name="excelImport:import">
							<button id="excelImport" type="button" class="btn btn-primary">
								<span class="glyphicon glyphicon-open"></span> 导入
							</button>
						</shiro:hasPermission>
						<shiro:hasPermission name="excelImport:export">
							<button id="excelExport" type="button" class="btn btn-primary">
								<span class="glyphicon glyphicon-save"></span> 导出
							</button>
						</shiro:hasPermission>
					</div>
				</div>
				<shiro:hasPermission name="excelImport:update">
					<div id="dlg" class="easyui-dialog"
						style="width: 400px; height: 380px; padding: 10px 20px"
						data-options="resizable:true,modal:true, buttons:'#dlg-btn',closed:true">
						<form id="fm" method="post">
							<input type="hidden" name="id" />

							<table id="tbl">
								<tr>
									<td><label>导入编号:</label></td>
									<td><input name="importNo" class="easyui-validatebox"
										data-options="required:true"></td>
								</tr>
								<tr>
									<td><label>模板名称:</label></td>
									<td><input name="importName" class="easyui-validatebox"
										data-options="required:true"></td>
								</tr>
								<tr>
									<td><label>表名称:</label></td>
									<td><input name="tableName" class="easyui-validatebox"
										data-options="required:true"></td>
								</tr>
								<tr>
									<td><label>是否覆盖:</label></td>
									<td><input id="isOverride" name="isOverride" type="hidden">
										<input id="isOverrideSB"></td>
								</tr>
								<tr>
									<td><label>是否有附件:</label></td>
									<td><input id="withAttachment" name="withAttachment" type="hidden">
										<input id="withAttachmentSB"></td>
								</tr>
								<!-- <tr>
										<td><label>是否启用:</label></td>
										<td><input type="radio" id="radio11" name="enable"
											value="1"> <label for="radio11">是</label> <input
											type="radio" id="radio12" name="enable" value="2"> <label
											for="radio12">否</label></td>
									</tr> -->
								<tr>
									<td><label>备注:</label></td>
									<td><input name="remark" class="easyui-textbox"
										data-options="multiline:true,width:185,height:60"></td>
								</tr>
							</table>

						</form>
						<div id="dlg-btn">
							<button id="add" type="button" class="btn btn-primary"
								onclick="formSave('#fm', '#grid', '#dlg', '${ctx}/basic/excelImport/update');">
								<span class="glyphicon glyphicon-ok"></span> 保存
							</button>
							<button id="edit" type="button" class="btn btn-primary"
								onclick="$('#dlg').dialog('close');">
								<span class="glyphicon glyphicon-remove"></span> 取消
							</button>
						</div>
					</div>
				</shiro:hasPermission>
			</div>
			<div
				data-options="region:'east', title:'配置明细', split: true, collapsible:true"
				style="padding: 1px; witdh: 800px">
				<table id="excelConfigTreeGrid">
				</table>
				<div id="configtt" class="row">
					<div class="col-md-12">
						<shiro:hasPermission name="excelImport:update">
							<button id="configadd" type="button" class="btn btn-primary">
								<span class="glyphicon glyphicon-plus"></span> 新增
							</button>
							<button id="configedit" type="button" class="btn btn-primary">
								<span class="glyphicon glyphicon-pencil"></span> 修改
							</button>
						</shiro:hasPermission>
						<!-- Split button -->
						<div class="btn-group">
							<button type="button" class="btn btn-sm btn-primary">选项</button>
							<button type="button"
								class="btn btn-primary btn-sm dropdown-toggle"
								data-toggle="dropdown" aria-haspopup="true"
								aria-expanded="false">
								<span class="caret"></span> <span class="sr-only">Toggle
									Dropdown</span>
							</button>
							<ul class="dropdown-menu dropdown-menu-right">
								<li><shiro:hasPermission name="excelImport:delete">
										<a id="configdelete"> <span
											class="glyphicon glyphicon-minus"></span>
											&nbsp;删&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;除
										</a>
									</shiro:hasPermission></li>
								<li><shiro:hasPermission name="excelImport:import">
										<a id="excelImportConfig"> <span
											class="glyphicon glyphicon-open"></span>
											&nbsp;导&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;入
										</a>
									</shiro:hasPermission></li>
								<li><shiro:hasPermission name="excelImport:export">
										<a id="excelExportConfig"> <span
											class="glyphicon glyphicon-save"></span>
											&nbsp;导&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;出
										</a>
									</shiro:hasPermission></li>
								<li><shiro:hasPermission name="excelImport:update">
										<a id="save"> <span
											class="glyphicon glyphicon-floppy-save"></span>
											&nbsp;保&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存
										</a>
									</shiro:hasPermission></li>
								<li><shiro:hasPermission name="excelImport:update">
										<a id="redo"> <span class="glyphicon glyphicon-share-alt"></span>
											&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;消
										</a>
									</shiro:hasPermission></li>
								<li><a id="excelall"> <span
										class="glyphicon glyphicon-refresh"></span> &nbsp;显示全部
								</a></li>
								<li><shiro:hasPermission name="excelImport:bulid">
										<a id="build"> <span class="glyphicon glyphicon-file"></span>
											&nbsp;自动生成
										</a>
									</shiro:hasPermission></li>
							</ul>
						</div>
					</div>
				</div>
				<shiro:hasPermission name="excelImport:update">
					<div id="configdlg" class="easyui-dialog"
						style="width: 770px; height: 555px; padding: 10px 20px"
						data-options="resizable:true,modal:true, buttons:'#configdlg-btn',closed:true">
						<form id="configfm" method="post">
							<input type="hidden" name="id" /> 
							<input type="hidden" name="excelImport" />
							<input type="hidden" name="search_LIKE_columnName" />
							<table id="tbl">
								<tr>
									<td><label>中文列名:</label></td>
									<td><input name="chineseName" class="easyui-validatebox"
										data-options="required:true" /></td>
									<td><label>字段名称:</label></td>
									<td><input name="columnName" class="easyui-validatebox"
										data-options="required:true" /></td>
								</tr>
								<tr>
									<td><label>列序号:</label></td>
									<td><input name="columnNo" class="easyui-validatebox"
										data-options="required:true" /></td>
									<td><label>是否联合唯一:</label></td>
									<td><input id="isUnionUnique" type="hidden"
										name="isUnionUnique" /> <input id="isUnionUniqueSB" /></td>
								</tr>
								<tr>
									<td><label>是否外键:</label></td>
									<td><input id="isForeignKey" name="isForeignKey"
										type="hidden" /> <input id="isForeignKeySB" /></td>
									<td><label>Java类型:</label></td>
									<td><input id="javaType" name="javaType"
										class="easyui-validatebox" data-opations="required:true" /></td>
								</tr>
								<tr>
									<td><label>关联表名称:</label></td>
									<td><input name="foreignTableName"
										class="easyui-validatebox" /></td>
									<td><label>关联字段名称:</label></td>
									<td><input name="fkColumnName" class="easyui-validatebox" /></td>
								</tr>
								<tr>
									<td><label>关联表的辅助字段名称:</label></td>
									<td><input name="foreignTableAssistColumnName"
										class="easyui-validatebox" /></td>
									<td><label>辅助值Excel列号:</label></td>
									<td><input name="assistExcelColumnNo"
										class="easyui-validatebox" /> <br /> <font color="red">*从1开始计数</font></td>
								</tr>
								<tr>
									<td><label>辅助关联表名称:</label></td>
									<td><input name="assistForeignTableName"
										class="easyui-validatebox" /></td>
									<td><label>辅助关联字段名称:</label></td>
									<td><input name="assistFkColumnName"
										class="easyui-validatebox" /></td>
								</tr>
								<tr>
									<td><label>其他关联字段集:</label></td>
									<td><input name="otherColumns" class="easyui-validatebox" />
										<br /> <font color="red">*多个用”|“隔开</font></td>
									<td><label>其他关联字段值:</label></td>
									<td><input name="otherValues" class="easyui-validatebox" />
										<br /> <font color="red">*多个用”|“隔开</font></td>
								</tr>
								<tr>
									<td><label>转换Map:</label></td>
									<td><input name="convertMap" class="easyui-validatebox" />
										<br /> <font color="red">*例如：是:1|否:2</font></td>
									<td><label>是否是辅助字段:</label></td>
									<td><input type="hidden" id="isAssistColumn"
										name="isAssistColumn" /> <input id="isAssistColumnSB" /></td>
								</tr>
								<tr>
									<td><label>备注:</label></td>
									<td colspan="3"><textarea name="remark" cols="20" rows="2"></textarea></td>
								</tr>
							</table>
						</form>
						<div id="configdlg-btn">
							<button id="settype" type="button" class="btn btn-primary"
								onclick="fn_setCompany();">
								<span class="glyphicon glyphicon-tag"></span> 设置公司类型
							</button>
							<button id="setlink" type="button" class="btn btn-primary"
								onclick="fn_setAssist(); ">
								<span class="glyphicon glyphicon-link"></span> 设置辅助关联
							</button>
							<button id="savebtn" type="button" class="btn btn-primary"
								onclick="fn_configsave();">
								<span class="glyphicon glyphicon-ok"></span> 保存
							</button>
							<button id="cancelbtn" type="button" class="btn btn-primary"
								onclick="$('#configdlg').dialog('close');">
								<span class="glyphicon glyphicon-remove"></span> 取消
							</button>
						</div>
					</div>
				</shiro:hasPermission>
			</div>
		</div>
	</div>
</body>
</html>
